CREATE TABLE [dbo].[TTAMAR_DOPA]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTAMAR_DO__ST_CO__00EAD9C6] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTAMAR_DO__NU_PR__01DEFDFF] DEFAULT ((0)),
[NU_ASTO] [dbo].[TD_VC_010] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_DO__CO_US__02D32238] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_DO__FE_US__03C74671] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_DO__CO_US__04BB6AAA] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_DO__FE_US__05AF8EE3] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_DOPA] WITH NOCHECK ADD CONSTRAINT [CK__TTAMAR_DO__ST_CO__7F029154] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTAMAR_DOPA] WITH NOCHECK ADD CONSTRAINT [CK__TTAMAR_DO__ST_CO__7FF6B58D] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTAMAR_DOPA] ADD CONSTRAINT [PK__TTAMAR_D__DA2E927F7B320070] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_DOPA] ADD CONSTRAINT [FK__TTAMAR_DOPA__7D1A48E2] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TTAMAR_DOPA] ADD CONSTRAINT [FK__TTAMAR_DOPA__7E0E6D1B] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR]) REFERENCES [dbo].[TCDOCU_PAGA] ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR])
GO
